<?php
$bottom_margin = $_MODULE[bottom_margin];
$bottom_color = $_MODULE[bottom_color];
if (!isset($bottom_margin)) $bottom_margin = 0;
if (!isset($bottom_color)) $bottom_color = "#FFFFFF";
$positive_default_image = "assets/images/positive-default.jpg";
$reverse_default_image = "";

$paramArray = array();
?>
<div class="module dshop-um-ggw1 module-thirdparty"
     style="margin-bottom:<? echo $bottom_margin; ?>px; background-color:<? echo $bottom_color; ?>;">
    <table>
        <tr>
        <?php

        $padding_right_str = "padding-right: 15px;";
        for ($i = 0; $i < 3; $i++) {
            $positive_image_url_ = $_MODULE['positive_image_url_' . $i];
            $reverse_image_url_ = $_MODULE['reverse_image_url_' . $i];
            $link_url_ = $_MODULE['link_url_' . $i];

            $main_title = $_MODULE['big_title_' . $i];
            $sub_title = $_MODULE['small_title_' . $i];

            $main_title_color = $_MODULE['big_title_color_' . $i];
            $sub_title_color = $_MODULE['small_title_color_' . $i];

            $positive_image_url_ = empty($positive_image_url_) ? $positive_default_image:$positive_image_url_;
            $reverse_image_url_ = empty($reverse_image_url_) ? $reverse_default_image:"style='background-image:url($reverse_image_url_);'";

            $link_url_ = empty($link_url_) ? '':"href='$link_url_'";

            $main_title = empty($main_title) ? '主标题':$main_title;
            $sub_title = empty($sub_title) ? '副标题':$sub_title;

            $main_title_color = empty($main_title_color) ? '#9BCD9B':$main_title_color;
            $sub_title_color = empty($sub_title_color) ? '#EEDC82':$sub_title_color;

            if($i==2) $padding_right_str ='';

            echo "
                <td width='33%' style='$padding_right_str'>
                    <a $link_url_ target='_blank' class='no_decoration'>
                        <div class='positive_bg_img'  style='background-image:url($positive_image_url_);'>
                            <div class='title'>
                                <p class='main_title ' style='color: $main_title_color;'>$main_title</p>
                                <p class='sub_title' style='color: $sub_title_color;'>$sub_title</p>
                            </div>
                            <div class='reverse_bg_img'  $reverse_image_url_>
                                <div class='title'>
                                    <p class='main_title' style='color: $main_title_color;'>$main_title</p>
                                    <p class='sub_title'  style='color: $sub_title_color;'>$sub_title</p>
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
            ";

        }

        ?>
        </tr>
    </table>
</div>
